package com.bite.demo.controller;

import com.bite.demo.model.BookInfo;
import com.bite.demo.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@RequestMapping("/book")
@RestController
public class BookController {
    @Autowired//从Spring中取出对象
    private BookService bookService;
    @RequestMapping("/getList")
    public List<BookInfo> getList(){
        //没有数据，采用mock的方式（伪造假的数据）
       // BookService bookService = new BookService();
       List<BookInfo> bookInfos = bookService.getList();
       return bookInfos;
    }

    /**
     * mock数据
     * @return
     */

}
